package tgc.edu.yzy.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="yzy_bj")
public class Bj {
	private Integer id;
	private String bjname;//班级时class  为避免关键字 所有用汉语缩写代替
	private String bjteacher;//班级辅导员 
	private List<Student> student=new ArrayList<>();
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(length=20)
	public String getBjname() {
		return bjname;
	}
	public void setBjname(String bjname) {
		this.bjname = bjname;
	}
	@Column(length=20)
	public String getBjteacher() {
		return bjteacher;
	}
	public void setBjteacher(String bjteacher) {
		this.bjteacher = bjteacher;
	}
	@OneToMany(cascade=CascadeType.ALL,mappedBy="bj")
	public List<Student> getStudent() {
		return student;
	}
	public void setStudent(List<Student> student) {
		this.student = student;
	}
	public Bj(Integer id, String bjname, String bjteacher, List<Student> student) {
		super();
		this.id = id;
		this.bjname = bjname;
		this.bjteacher = bjteacher;
		this.student = student;
	}
	public Bj(String bjname, String bjteacher, List<Student> student) {
		super();
		this.bjname = bjname;
		this.bjteacher = bjteacher;
		this.student = student;
	}
	public Bj() {
		super();
	}
	public Bj(Integer id) {
		super();
		this.id = id;
	}
	
	
}
